//
//  HWBaseTabBarController.m
//  HappyWeekend
//
//  Created by lanou on 16/1/12.
//  Copyright © 2016年 com.mjykj.www. All rights reserved.
//

#import "HWBaseTabBarController.h"
#import "HWHomePageMainListVC.h"
#import "HWItemMainListVC.h"
#import "HWTopicsMainListVC.h"
#import "HWMyInfoMainListVC.h"

@interface HWBaseTabBarController ()

@end

@implementation HWBaseTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self addViewControllerClass:[HWHomePageMainListVC class] title:@"首页" imageName:@"shouye" selectImageName:nil];
    
    [self addViewControllerClass:[HWItemMainListVC class] title:@"单品" imageName:@"danping" selectImageName:nil];
    
    [self addViewControllerClass:[HWTopicsMainListVC class] title:@"分类" imageName:@"fenlei" selectImageName:nil];
    
    [self addViewControllerClass:[HWMyInfoMainListVC class] title:@"我的" imageName:@"wo" selectImageName:nil];
    
    
}


- (void)addViewControllerClass:(Class)class title:(NSString *)title imageName:(NSString *)imageName selectImageName:(NSString *)selectImageName
{
    UIViewController *viewVC = [[class alloc]init];
    UINavigationController *naVC = [[UINavigationController alloc] initWithRootViewController:viewVC];
    naVC.tabBarItem.title = title;
    naVC.tabBarItem.image = [UIImage imageNamed:imageName];
    viewVC.navigationItem.title = title;
    [self addChildViewController:naVC];
    
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
